package com.zyz.F_异常;

/**
 * @author: vick
 * @Date: 2025/3/18
 * @Description:
 * @version: 1.0
 */
public class Demo2 {
    public static void main(String[] args) {
        System.out.println("before");
        try {
            System.out.println(10/0);
        }catch (Exception e){
            System.out.println("出现异常了");
            e.printStackTrace(); //打印完整的异常信息
        } finally {
            System.out.println("不管程序是否出现异常，都会执行");
        }
        System.out.println("after");
    }
}
